/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mortbay.jetty.pico.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Hnmtuan
 */
@Entity
@Table(name = "manufacturer")
@NamedQueries({
    @NamedQuery(name = "Manufacturer.findAll", query = "SELECT m FROM Manufacturer m"),
    @NamedQuery(name = "Manufacturer.findByIdManu", query = "SELECT m FROM Manufacturer m WHERE m.idManu = :idManu"),
    @NamedQuery(name = "Manufacturer.findByManuName", query = "SELECT m FROM Manufacturer m WHERE m.manuName = :manuName"),
    @NamedQuery(name = "Manufacturer.findByManuDescription", query = "SELECT m FROM Manufacturer m WHERE m.manuDescription = :manuDescription"),
    @NamedQuery(name = "Manufacturer.findByManuState", query = "SELECT m FROM Manufacturer m WHERE m.manuState = :manuState"),
    @NamedQuery(name = "Manufacturer.findByManuUrl", query = "SELECT m FROM Manufacturer m WHERE m.manuUrl = :manuUrl")})
public class Manufacturer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idManu")
    private String idManu;
    @Column(name = "ManuName")
    private String manuName;
    @Column(name = "ManuDescription")
    private String manuDescription;
    @Column(name = "ManuState")
    private Integer manuState;
    @Column(name = "ManuUrl")
    private String manuUrl;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "manufacturer")
    private List<Item> itemList;

    public Manufacturer() {
    }

    public Manufacturer(String idManu) {
        this.idManu = idManu;
    }

    public String getIdManu() {
        return idManu;
    }

    public void setIdManu(String idManu) {
        this.idManu = idManu;
    }

    public String getManuName() {
        return manuName;
    }

    public void setManuName(String manuName) {
        this.manuName = manuName;
    }

    public String getManuDescription() {
        return manuDescription;
    }

    public void setManuDescription(String manuDescription) {
        this.manuDescription = manuDescription;
    }

    public Integer getManuState() {
        return manuState;
    }

    public void setManuState(Integer manuState) {
        this.manuState = manuState;
    }

    public String getManuUrl() {
        return manuUrl;
    }

    public void setManuUrl(String manuUrl) {
        this.manuUrl = manuUrl;
    }

    public List<Item> getItemList() {
        return itemList;
    }

    public void setItemList(List<Item> itemList) {
        this.itemList = itemList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idManu != null ? idManu.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Manufacturer)) {
            return false;
        }
        Manufacturer other = (Manufacturer) object;
        if ((this.idManu == null && other.idManu != null) || (this.idManu != null && !this.idManu.equals(other.idManu))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.mortbay.jetty.pico.entities.Manufacturer[idManu=" + idManu + "]";
    }

}
